<template>
	<view>
		<tt-bar leftIcon="icon-back" bgColor="rgba(0,0,0,0)" color="#ffffff" :showZhanwei="false"></tt-bar>
		<view class="bg">
			<view class="ts">
				<text>可提现金额</text>
				<button @tap="toPage" data-url="withDrawal">立即提现</button>
			</view>
			<text class="count">￥{{userInfo.amount}}</text>
		</view>
		<view class="tabHead">
			<text class="headItem" :class="[showType==1?'active':'']" @tap="toggleType(1)">团长奖励</text>
			<text class="headItem " :class="[showType==2?'active':'']" @tap="toggleType(2)">提现记录</text>
		</view>
		<view class="tabCnt" v-if="showType==1">
			<scroll-view :style="{'height':scHeight+'px'}" :scroll-y="true">
				<view class="list">
					<view class="item">
						<text>2020年3月团长奖励</text>
						<text class="count">999.99</text>
					</view>
					<view class="item">
						<text>2020年3月团长奖励</text>
						<text class="count">999.99</text>
					</view>
				</view>
			</scroll-view>
		</view>
		<view class="tabCnt" v-if="showType==2">
			<scroll-view :style="{'height':scHeight+'px'}" :scroll-y="true">
				<view class="list">
					<view class="row">
						<view class="left">
							<text>提现人：张三</text>
							<text>支付宝：张三</text>
							<text class="time">2020-03-24 18:54:06</text>
						</view>
						<view class="right">
							<text>￥9999.99</text>
							<text class="status">已到账</text>
						</view>
					</view>
					<view class="row">
						<view class="left">
							<text>提现人：张三</text>
							<text>支付宝：张三</text>
							<text class="time">2020-03-24 18:54:06</text>
						</view>
						<view class="right">
							<text>￥9999.99</text>
							<text class="status">已到账</text>
						</view>
					</view>
					<view class="row">
						<view class="left">
							<text>提现人：张三</text>
							<text>支付宝：张三</text>
							<text class="time">2020-03-24 18:54:06</text>
						</view>
						<view class="right">
							<text>￥9999.99</text>
							<text class="status">已到账</text>
						</view>
					</view>
					<view class="row">
						<view class="left">
							<text>提现人：张三</text>
							<text>支付宝：张三</text>
							<text class="time">2020-03-24 18:54:06</text>
						</view>
						<view class="right">
							<text>￥9999.99</text>
							<text class="status">已到账</text>
						</view>
					</view>
					<view class="row">
						<view class="left">
							<text>提现人：张三</text>
							<text>支付宝：张三</text>
							<text class="time">2020-03-24 18:54:06</text>
						</view>
						<view class="right">
							<text>￥9999.99</text>
							<text class="status">已到账</text>
						</view>
					</view>
					<view class="row">
						<view class="left">
							<text>提现人：张三</text>
							<text>支付宝：张三</text>
							<text class="time">2020-03-24 18:54:06</text>
						</view>
						<view class="right">
							<text>￥9999.99</text>
							<text class="status">已到账</text>
						</view>
					</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapGetters,
		mapMutation,
		mapActions
	} from "vuex";
	export default {
		computed: {
			...mapState({
				userInfo: state => state.user.userInfo
			}),
		},
		data() {
			return {
				showType:1,
				scHeight:uni.getSystemInfoSync().screenHeight-uni.upx2px(576)
			};
		},
		methods:{
			toggleType(e){
				this.showType=parseInt(e)
			},
			getData(){
				
			}
		},
		onLoad() {
			uni.$on("tixian",()=>{
				this.showType=2;
				this.getData()
			})
		}
	}
</script>

<style lang="less">
	.bg {
		height: 466upx;
		padding: 0 42upx;
		background-image: linear-gradient(0deg,#da2c5c 0%,#e22f43 100%);
		padding-bottom: 120upx;
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		margin-bottom: 20upx;
		.ts{
			display: flex;
			width: 100%;
			align-items: center;
			font-size: 32upx;
			color: #FFFFFF;
			justify-content: space-between;
			button{
				margin: 0;
				height: 60upx;
				line-height: 60upx;
				border: none;
				outline: none;
				font-size: 32upx;
				border-radius: 30upx;
				color: #e12f45;
				padding: 0 40upx;
			}
		}
		.count{
			font-size: 80upx;
			color: #FFFFFF;
			margin-top: 40upx;
		}
	}
	.tabHead{
		height: 90upx;
		display: flex;
		justify-content: space-around;
		border-bottom: 2upx solid #f2f2f2;
		text{
			font-size: 32upx;
			line-height: 82upx;
			border-bottom: 6upx solid rgba(0,0,0,0);
			color: #202932;
		}
		.active{
			color: #f79f21;
			border-bottom: 6upx solid #f79f21;
		}
	}
	.list{
		display: flex;
		flex-direction: column;
		
		.item{
			padding: 30upx 70upx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1px solid #EEEEEE;
			text{
				font-size: 32upx;
			}
			.count{
				font-size: 40upx;
				font-weight: bold;
			}
		}
		.row{
			padding: 30upx 32upx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1px solid #EEEEEE;
			.left{
				display: flex;
				flex-direction: column;
				font-size: 28upx;
				margin-bottom: 5upx;
				.time{
					font-size: 24upx;
					color: #999999;
				}
			}
			.right{
				display: flex;
				flex-direction: column;
				align-items: flex-end;
				font-size: 40upx;
				font-weight: bold;
				.status{
					font-size: 28upx;
					color: #999999;
					font-weight: normal;
				}
			}
		}
	}
</style>
